#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 1000010;

char s[N];
int dp[N][2];

int main()
{
    scanf("%s", s + 1);
    int n = strlen(s + 1);
    for (int i = 1; i <= n; i++)
    {
        dp[i][0] = max(dp[i - 1][0], dp[i - 1][1]);
        dp[i][1] = dp[i - 1][0] + s[i] - 'a' + 1;
    }
    printf("%d\n", max(dp[n][1], dp[n][0]));
    return 0;
}